<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-user-add">
			<input name="deptId"  type="hidden" th:value="${user.deptId}"/>
			<input name="createBy"  type="hidden" th:value="${user.deptId}"/>
			<input name="roleIds" type="hidden" value="5" />
			<div class="form-group">
				<label class="col-sm-3 control-label ">考号：</label>
				<div class="col-sm-8">
					<input th:value="${user.id}" class="form-control" type="text" id="id" name="id" readonly/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">班级：</label>
				<div class="col-sm-8">
					<input th:value="${user.classg}" class="form-control" type="text" name="classg" id="classg">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">姓名：</label>
				<div class="col-sm-8">
					<input th:value="${user.userName}" class="form-control" type="text" name="userName" id="userName">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">性别：</label>
				<div class="col-sm-8">
					<label class="radio-box"> <input type="radio" name="gender" value="0" th:checked="${!user.gender}" /> 男 </label>
					<label class="radio-box"> <input type="radio" name="gender" value="1" th:checked="${user.gender}"/> 女 </label>
				</div>
			</div>
		</form>
	</div>
	<div th:include="include::footer"></div>
	<script th:src="@{/assets/plugins/select/select2.js}"></script>
	<script>
        $("#form-user-add").validate({
			onkeyup: false,
        	rules:{
        		classg:{
        			required:true,
        			minlength:2
        		},
        		userName:{
        			required:true
        		}
        	}
        });
        
        function submitHandler() {
	        if ($.validate.form()) {
	        	add();
	        }
	    }

        function add() {
        	$.ajax({
        		cache : true,
        		type : "POST",
        		url : ctx + "exam/exarrange/kdeditDo",
        		data : $('#form-user-add').serialize(),
        		async : false,
        		error : function(request) {
        			$.modal.alertError("系统错误");
        		},
        		success : function(data) {
        			$.operate.successCallback(data);
        		}
        	});
        }
    </script>
</body>
</html>
